package top.kangyaocoding.ecommerce;

import org.springframework.web.multipart.MultipartFile;
import top.kangyaocoding.ecommerce.dto.UsersDTO;
import top.kangyaocoding.ecommerce.response.Response;

import java.io.IOException;
import java.util.List;

/**
 * 描述: 用户服务接口
 *
 * @author K·Herbert
 * @since 2025-02-17 上午11:40
 */
public interface IUsersService {
    Response<String> loginByPassword(String email, String password) throws Exception;

    Response<String> loginByVerificationCode(String email, String verificationCode);

    Response<Boolean> register(String email, String password, String verificationCode);

    void sendVerificationCode(String email);

    Response<UsersDTO> getUserInfo(String email);

    Response<Boolean> updateUserPassword(String email, String verificationCode, String newPassword);

    Response<String> getUserEmailAndSendVerificationCode(String token);

    Response<Boolean> updateUserAvatar(MultipartFile file, String token) throws IOException;

    Response<Boolean> updateUserInfo(String nickname, String biography, String token);

    Response<List<UsersDTO>> getUserList(String token);

    Response<Boolean> editUser(String email, String status, String role, String token);

    Response<Boolean> resetPassword(String email, String token);
}
